package com.funtl.spring.cloud.alibaba.provider.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

//import org.springframework.cloud.context.config.annotation.RefreshScope;

@RestController
@RefreshScope
public class ProviderAdminController {
    @Value(value = "${external.username}")
    private String username;

    @Value("${spring.application.name}")
    private String serviceName;

    @Value("${dubbo.protocol.port}")
    private String dubbo_port;

    @Value(value = "${server.port}")
    private String port;

    @GetMapping(value = "hi")
    public String sayHi() {
        return "i am from HTTP port: "+port+"RPC port: "+dubbo_port+"--username: "+username+"spring.application.name:"+serviceName;
    }

}
